package it.unical.mat.aec.gui;

import java.io.File;

import javax.swing.JFileChooser;
import javax.swing.JPanel;

public class CaricaFile {
	
	public static File[] getFile(JPanel panel){
		JFileChooser chooser=new JFileChooser();
		chooser.setMultiSelectionEnabled(true);
		int returnVal = chooser.showOpenDialog(panel);
		if(returnVal==JFileChooser.APPROVE_OPTION){
			return chooser.getSelectedFiles();
		}
		return null;
	}
	
	public static String getDirectory(JPanel panel){
		JFileChooser chooser=new JFileChooser();
		int returnVal = chooser.showSaveDialog(panel);
		if(returnVal==JFileChooser.APPROVE_OPTION){
			return chooser.getSelectedFile().getPath();
		}
		return null;
	}
}
